Add generic ResidualChain composing method#430
Conversation
Implements ResidualSequence Struct and StackWith trait for composing regression models in a boosting / residual-stacking pattern. The second (and any further) model trains on the residuals left by the previous one; predictions are summed. Docs and tests were written with AI assistance.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #430 +/- ##
=======================================
Coverage 76.76% 76.76%
=======================================
Files 105 106 +1
Lines 7359 7411 +52
=======================================
+ Hits 5649 5689 +40
- Misses 1710 1722 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi! It looks like a nice addition! I think you should move it in the |
|
Hi @relf, absolutely composing is the better place for this to be! I have moved it to composing/residual-sequence. |
relf
left a comment
There was a problem hiding this comment.
Ok, I think you should take a look at the contribution guidelines. Specially the sections about the implementation of PredictInplace trait and the optional serde support. As there is no hyperparameters (at the moment?), I guess you can skip the ParamGuard pattern.
Implement Shrinkage implement paramguard for shrinkage
rename stack_with -> chain_shrunk
ResidualChain composing method
|
This addition may help address #411. |
|
Thanks for reviewing! |
Hi! Wanted to float the idea of a small crate for chaining models together additively, fitting each model with the residuals of the previous one, like below
feels like a natural ergonomic addition which could sit as a crate in linfa.
Happy to hear if this belongs somewhere else (folded into an existing crate, or not at all).